<template>
	<view class="zh-userCenter-map">
		<view class="box" @click="back">
			<image src="@/static/icons/left_arrow.png"/>
		</view>
		<map :latitude="latitude" :longitude="longitude" :scale="16" :markers="markers"></map>
	</view>
</template>

<script setup lang="ts">
	import { ref, reactive } from 'vue'
	import { onLoad } from '@dcloudio/uni-app';
	import { util } from '@/utils'
	
	const latitude = ref('')
	const longitude = ref('')
	
	const markers = ref([])
	
	onLoad((options:any) => {
		const info = util.getObjParams(options.info)
		markers.value = info
		latitude.value = info[0].latitude
		longitude.value = info[0].longitude
	})
	
	const back = () => {
		uni.navigateBack({
			delta:1
		})
	}
</script>
<style>
	page {
		width:100%;
		height:100%;
	}
</style>
<style lang="scss" scoped>
	.zh-userCenter-map {
		width:100%;
		height:100%;
		.box {
			position:fixed;
			top:var(--status-bar-height);
			left:30rpx;
			z-index: 10;
			image {
				width: 44rpx;
				height: 44rpx;
				margin-top:10rpx;
			}
		}
		map {
			width:100%;
			height:100%;	
		}
	}
</style>
